home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-04 | 2.5 KB | 81 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CPrefListBox.h
- // Written by Christophe Causer
- // ©1995 BlueDays Software. All Rights Reserved.
- //
- // You may use this class in any non-commercial program without
- // permission. The only restriction is that you must credit the
- // author in your about box. For commercial use, please contact
- // the author at the email address below.
- //
- // Send bug-reports and comments to bluedays@kagi.com
- //
- // ===========================================================================
-
- #pragma once
-
- #include <LListBox.h>
-
- //----------------------------------------------------------------------------
-
- typedef struct {
- Int16 prefIconID;
- ResIDT prefSTRxID;
- Int16 prefSTRidx;
- PaneIDT prefViewID;
- LView *prefView;
- } sPrefItem, *sPrefItemPtr ;
-
- class LArray;
-
- class CPrefListBox : public LListBox {
-
- public:
- enum {
- class_ID = 'LPRF'
- } ;
-
- static CPrefListBox* CreateFromStream(LStream *inStream);
-
- CPrefListBox ();
- CPrefListBox(const SPaneInfo &inPaneInfo,
- Boolean inHasHorizScroll, Boolean inHasVertScroll,
- Boolean inHasGrow, Boolean inHasFocusBox,
- MessageT inDoubleClickMessage, Int16 inTextTraitsID,
- LCommander *inSuper);
- CPrefListBox(const CPrefListBox &inOriginal) ;
- CPrefListBox (LStream *inStream);
- ~CPrefListBox();
-
- virtual void *GetSelection (void *outDescriptor, short *outDescLen) const;
- virtual void SetSelection (const void *inDescriptor, const short inDescLen);
-
- virtual void *GetCellPtr (const Cell cell, short *dataLen = NULL) ;
-
- virtual void PrintPanelSelf(const PanelSpec &inPanel);
-
- virtual void InsertItemsAt( Uint32 inCount, ArrayIndexT inAtIndex, const void *inItem);
- virtual Boolean FetchItemAt( ArrayIndexT inAtIndex, void *outItem) const;
-
- virtual LArray& GetItemList();
-
- protected:
- virtual void FinishCreateSelf();
- virtual void DrawElement (const short lMessage, const Boolean lSelect, const Rect *lRect,
- const void *lElement, const short lDataLen) ;
-
- virtual Boolean HandleKeyPress( const EventRecord &inKeyEvent);
- virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
-
- private:
- LArray *mPrefList;
- static ListDefUPP callerLDEFUPP;
-
-
- void InitPrefListBox (void) ;
- friend pascal static void LDefProc (short lMessage, Boolean lSelect, Rect *lRect,
- Cell lCell, unsigned short lDataOffset, unsigned short lDataLen, ListHandle lHandle) ;
- };
-
- //----------------------------------------------------------------------------
-